<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>三镇智游 - 武汉旅游网</title>
    {% load static %}
    <!-- 全局基础样式 -->
    <link rel="stylesheet" href="{% static 'css/base.css' %}">
    <!-- 论坛专用样式（会被其他页面的block覆盖） -->
    <link rel="stylesheet" href="{% static 'css/forum.css' %}">
    <!-- 页面专属CSS钩子 -->
    {% block extra_css %}{% endblock %}
</head>
<body>
    <!-- 导航栏 -->
    <nav class="nav">
        <!-- Logo和网站名 -->
        <div class="nav-brand">
            <a href="{% url 'index' %}">
                <img src="{% static 'images/logo.png' %}" alt="三镇智游Logo" class="logo-img">
            </a>
            <a href="{% url 'index' %}" class="brand-name">三镇智游Tour</a>
        </div>

        <!-- 导航菜单 -->
        <div class="nav-links">
            <a href="{% url 'index' %}">首页</a>
            <a href="{% url 'scenic:list'%}">风景名胜</a>
            <a href="{% url 'forum:post_list' %}">论坛</a>
            <a href="{% url 'ai_assistant:chat_page' %}">智能咨询</a>
        </div>

        <!-- 用户信息 -->
        <div class="user-info">
            {% if user.is_authenticated %}
                <div class="user-panel">
                <span class="username">{{ user.username }}</span>
                <img src="{{ user.get_avatar_url }}"
                    alt="用户头像"
                    class="user-avatar"
                    onclick="location.href='{% url 'users:profile' %}'">
                <a href="{% url 'users:logout' %}" class="logout-btn">退出</a>
        </div>
    {% else %}
        <div class="auth-links">
            <a href="{% url 'users:register' %}" class="register-btn">注册</a>
            <a href="{% url 'users:login' %}" class="login-btn">登录</a>
        </div>
    {% endif %}
</div>
    </nav>

    <!-- 页面内容 -->
    {% block content %}{% endblock %}

    {% block extra_js %}{% endblock %}

</body>
</html>